package com.cy.pj.common.advisor;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import sun.reflect.MethodAccessor;


public class LogAdvice implements MethodInterceptor {

    /** 此方法可以在目标业务方法执行之前和之后添加扩展逻辑 */
    @Override
    public Object invoke(MethodInvocation invocation) throws Throwable {
        System.out.println("start:"+System.nanoTime());

        Object result=invocation.proceed();

        System.out.println("end:"+System.nanoTime());

        return result;
    }
}
